﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Opo.Perspective.Core;

namespace Opo.Perspective.Web.Controllers
{
    [HandleError]
    public class MailController : Controller
    {
        IService<Message> _mailService;

        public MailController(IService<Message> mailService)
        {
            if (mailService == null)
            {
                throw new ArgumentNullException("mailService");
            }
            _mailService = mailService;
        }

        public ActionResult Index()
        {
            return RedirectToAction("Inbox");
        }

        public ActionResult Inbox()
        {
            return View(_mailService.GetAll());
        }

        public ActionResult Sent()
        {
            ViewData["Title"] = "Sent messages";

            return View();
        }
    }
}